#! /usr/bin/env python
# -*- coding: utf8 -*-

import sys
import random
import zope.interface

import base

if __name__ == '__main__':
    print "You shouldn't be running this file!"
    sys.exit()

class rename(object):
    zope.interface.implements(base.IAlgorithm)
    name = "rename"

    def __init__(self, node):
        self.__nameList = []

        for i in node.findall("./parameters/nameList/name"):
            self.__nameList.append(i.text.strip())

    def __call__(self, node, parentMap, root):
        node.tag = random.choice(self.__nameList)

__plugins__ = (rename, )
